cmake_minimum_required(VERSION 3.19 FATAL_ERROR)
project(platform LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 14)

add_executable(helloworld main.cpp)

target_compile_definitions(helloworld PUBLIC "ARCHITECTURE=\"${CMAKE_HOST_SYSTEM_PROCESSOR}\"")

message(STATUS "Architecture: ${CMAKE_HOST_SYSTEM_PROCESSOR}")

if(CMAKE_SIZEOF_VOID_P EQUAL 8)
  target_compile_definitions(helloworld PUBLIC "IS_64_BIT_ARCH")
  message(STATUS "Target is 64 bits")
else()
  target_compile_definitions(helloworld PUBLIC "IS_32_BIT_ARCH")
  message(STATUS "Target is 32 bits")
endif()

if(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "x86_64")
  message(STATUS "PROCESSOR x86_64")
endif()
